#!/usr/bin/perl
use warnings;
use strict;
use Test::More tests => 5;
use Data::Dumper;

BEGIN{
	use_ok( 'Data::Form::Field::Text');
}

can_ok('Data::Form::Field::Text',
	qw/ id default validators value errors label input_hint help readonly required valid many/);

can_ok('Data::Form::Field::Text', qw/validate validate_custom get add/);

my $field = Data::Form::Field::Text->new(
		name		=> 'name',
		required	=> 1,
		validators	=> {'%s must contain only word chars' => sub {shift; /^(\w|\s)+$/ ? 1 : 0 } },
);

#diag( Dumper $field );
isa_ok( $field, 'Data::Form::Field::Text');

$field->fill_in('Billy' );
is( $field->valid, 1, 'Valid Input');
